import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './dialog.less'

class Dialog extends Component {
    constructor(){
        super(...arguments);
    }
    shouldComponentUpdate(nextProps, nextState) {
        if(_.isEqual(this.paops, nextProps)){
            return false
        }
        return true
    }

    componentWillReceiveProps(nextProps) {

    }

    componentDidMount() {

    }

    render() {
        const { dialogInfo } = this.props;
        return(
            <div className="dialog-wrapper" onClick={e => this.props.close()}>
                <div className="dialog" onClick={ e => e.stopPropagation() }>
                    <p className="title">{dialogInfo.info.name}的弹窗</p>  
                </div>
            </div>
        )
    }
}

Dialog.propTypes = {
    dialogInfo: PropTypes.object.isRequired,
    close: PropTypes.func.isRequired
}

export default Dialog;